package cn.baage.campus.service;

import org.springframework.data.redis.core.RedisCallback;

import java.util.Collection;
import java.util.Set;

/**
 * @Description: RedisService 接口
 * @Author: 八阿哥
 * @url: baage.cn
 * @Version: 1.0
 **/
public interface RedisService<T> {

    void setJsonVal(String key, String value);

    String getJsonVal(String key);

    void set(String key, T value);

    void set(String key, T value, long time);

    T get(String key);

    Set<String> getKeys(String keyPattern);

    void delete(String key);

    void delete(Collection<String> keys);

    boolean expire(String key, long time);

    Long getExpire(String key);

    boolean hasKey(String key);

    Long increment(String key, long delta);

    Long decrement(String key, long delta);

    void addSet(String key, T value);

    Set<T> getSet(String key);

    void deleteSet(String key, T value);

    T execute(RedisCallback<T> redisCallback);
}